<?xml version="1.0" encoding="utf-8" ?> 

<sqlMap 
	namespace="Issue" 
  xmlns="http://ibatis.apache.org/mapping" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	>

	<!-- XML "behind" document for the People service class. -->

	<alias>
		<typeAlias alias="SystemUser" type="RaisingStudio.Data.Entities.SystemUser, RaisingStudio.Data.Entities" />
	</alias>
	
	<resultMaps>
		<resultMap id="SystemUser" class="SystemUser">
			<result property="UserID" column="USER_ID" />
			<result property="UserName" column="USERNAME" />
			<result property="FullName" column="FULLNAME" />
			<result property="Password" column="USER_PWD" />
			<result property="ChangingPassword" column="CHANGINGPWD" />
			<result property="UserLocked" column="USERLOCKED" />
			<result property="LastLogin" column="LASTLOGIN" />
			<result property="UserDescription" column="USER_DESC" />
		</resultMap>
	</resultMaps>
	
	<statements>
	
		<select id="SelectSystemUser"  resultMap="SystemUser">
      SELECT USER_ID, USERNAME, FULLNAME, USER_PWD, CHANGINGPWD, USERLOCKED, LASTLOGIN, USER_DESC FROM DAC_USER
    </select>

    <insert id="InsertSystemUser" parameterClass="SystemUser">
      INSERT INTO DAC_USER (USER_ID, USERNAME, FULLNAME, USER_PWD, CHANGINGPWD, USERLOCKED, LASTLOGIN, USER_DESC)
      VALUES (#UserID#, #UserName#, #FullName#, #Password#, #ChangingPassword#, #UserLocked#, #LastLogin#, #UserDescription#)
    </insert>

    <update id="UpdateSystemUser" parameterClass="SystemUser">
      UPDATE DAC_USER SET USERNAME = #UserName#, FULLNAME = #FullName#, USER_PWD = #Password#, CHANGINGPWD = #ChangingPassword#, USERLOCKED = #UserLocked#, LASTLOGIN = #LastLogin#, USER_DESC = #UserDescription# WHERE USER_ID = #UserID#
    </update>

    <delete id="DeleteSystemUser" parameterClass="string">
      DELETE FROM DAC_USER WHERE USER_ID = #value#
    </delete>

  </statements>
	
</sqlMap>
